<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="op164582">pg_stat_replication</title>
  <body>
    <p>The <codeph>pg_stat_replication</codeph> view contains metadata of the
        <codeph>walsender</codeph> process that is used for Greenplum Database master mirroring.</p>
    <p>The <codeph><xref href="gp_stat_replication.xml#topic1"/></codeph> view contains
        <codeph>walsender</codeph> replication information for master and segment mirroring.</p>
    <table id="op164584">
      <title>pg_catalog.pg_stat_replication</title>
      <tgroup cols="4">
        <colspec colnum="1" colname="col1" colwidth="131pt"/>
        <colspec colnum="2" colname="col2" colwidth="100pt"/>
        <colspec colnum="3" colname="col3" colwidth="82pt"/>
        <colspec colnum="4" colname="col4" colwidth="136pt"/>
        <thead>
          <row>
            <entry colname="col1">column</entry>
            <entry colname="col2">type</entry>
            <entry colname="col3">references</entry>
            <entry colname="col4">description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry colname="col1"><codeph>pid</codeph></entry>
            <entry colname="col2">integer</entry>
            <entry colname="col3"/>
            <entry colname="col4">Process ID of WAL sender backend process. </entry>
          </row>
          <row>
            <entry colname="col1"><codeph>usesysid</codeph></entry>
            <entry colname="col2">integer</entry>
            <entry colname="col3"/>
            <entry colname="col4">User system ID that runs the WAL sender backend process</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>usename</codeph></entry>
            <entry colname="col2">name</entry>
            <entry colname="col3"/>
            <entry colname="col4">User name that runs WAL sender backend process.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>application_name</codeph></entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3"/>
            <entry colname="col4">Client application name.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>client_addr </codeph></entry>
            <entry colname="col2">name</entry>
            <entry colname="col3"/>
            <entry colname="col4">Client IP address.</entry>
          </row>
          <row>
            <entry><codeph>client_hostname</codeph></entry>
            <entry>text</entry>
            <entry/>
            <entry>The host name of the client machine.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>client_port </codeph></entry>
            <entry colname="col2">integer</entry>
            <entry colname="col3"/>
            <entry colname="col4">Client port number.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>backend_start </codeph></entry>
            <entry colname="col2">timestamp </entry>
            <entry colname="col3"/>
            <entry colname="col4">Operation start timestamp. </entry>
          </row>
          <row>
            <entry><codeph>backend_xmin</codeph></entry>
            <entry>xid</entry>
            <entry/>
            <entry>The current backend's <codeph>xmin</codeph> horizon.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>state</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">WAL sender state. The value can
                  be:<p><codeph>startup</codeph></p><p><codeph>backup</codeph></p><p><codeph>catchup</codeph></p><p><codeph>streaming</codeph></p></entry>
          </row>
          <row>
            <entry colname="col1"><codeph>sent_location</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">WAL sender xlog record sent location.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>write_location</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">WAL receiver xlog record write location.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>flush_location</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">WAL receiver xlog record flush location.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>replay_location</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">Standby xlog record replay location.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>sync_priority</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">Priority. the value is <codeph>1</codeph>.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>sync_state</codeph></entry>
            <entry colname="col2">text</entry>
            <entry colname="col3"/>
            <entry colname="col4">WAL sender synchronization state. The value is
                <codeph>sync</codeph>.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </body>
</topic>
